package org.jeecg.modules.simulator.factory.train.plan;



import java.util.*;
import java.util.stream.Collectors;

import org.jeecg.modules.simulator.factory.train.load.TrainPhysicsLoader;
import org.jeecg.modules.simulator.factory.train.load.TrainPhysicsRead;
import org.jeecg.modules.simulator.model.train.TrainPhysics;
import lombok.Getter;
import lombok.Setter;

/**
 * @BelongsProject: demo2
 * @BelongsPackage: com.miaohy.demo.vo.newventity.scene.factory
 * @Author: renzhg
 * @CreateTime: 2024-07-30  10:05
 * @Description: TODO
 * @Version: 1.0
 */
public class TrainPhysicsDataLoader {



    @Getter
    @Setter
    Map<String, TrainPhysics> trainPhysicsMap = new HashMap<>();
    TrainPhysicsLoader trainPhysicsRead = new TrainPhysicsRead();
//    @Getter
//    @Setter
//    Map<String, List<MetroTrain>> noAssignMetroTrainMap = new HashMap<>();

    /**
     * @description:列车的物理数据
     * @author: renzhg
     * @date: 2024/7/30 10:36
     **/
//    private void loadTrainType() {
//
//        trainPhysicsMap = initTrainPhyMap();
//    }

    public void loadData() {
//        loadTrainType();
        initTrainPhyMap();
    }

    public void initTrainPhyMap() {
        trainPhysicsRead.trainPsread();
        List<TrainPhysics> trainPhysics = trainPhysicsRead.getTrainPhysicsList();
        trainPhysicsMap= trainPhysics.stream().collect(Collectors.toMap(TrainPhysics::getTrainName, e -> e));

    }




}
